<!DOCTYPE html>
<html>

<head>
  <title>{{ title }}</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="shortcut icon" href="https://uploadfile.huiyi8.com/up/65/bf/27/65bf2795ee640846dba996758bca188a.png">
  <!-- UIkit CSS -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.21.12/dist/css/uikit.min.css" />
  <!-- UIkit JS -->
  <script src="https://cdn.jsdelivr.net/npm/uikit@3.21.12/dist/js/uikit.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/uikit@3.21.12/dist/js/uikit-icons.min.js"></script>
  <!-- <link rel="stylesheet" href="/static/md-style/01_fslong/default.css"> -->
  <style>
    * {
      box-sizing: border-box;
    }

    ul {
      list-style-type: none;
    }

    body {
      font-family: Verdana, sans-serif;
    }

    .month {
      padding: 15px 25px;
      width: 100%;
      background: #1abc9c;
    }

    .month ul {
      margin: 0;
      padding: 0;
    }

    .month ul li {
      color: white;
      font-size: 20px;
      text-transform: uppercase;
      letter-spacing: 3px;
    }

    .month .prev {
      float: left;
      padding-top: 10px;
      cursor: pointer;
    }

    .month .next {
      float: right;
      padding-top: 10px;
      cursor: pointer;
    }

    .weekdays {
      margin: 0;
      padding: 5px 0;
      background-color: #ddd;
    }

    .weekdays li {
      display: inline-block;
      width: 13.5%;
      color: #666;
      text-align: center;
      font-size: 14px;
    }

    .days {
      padding: 5px 0;
      background: #eee;
      margin: 0;
    }

    .days li {
      list-style-type: none;
      display: inline-block;
      width: 14%;
      text-align: center;
      margin-bottom: 5px;
      font-size: 14px;
      color: #777;
    }

    .days li .active {
      padding: 5px;
      background: #1abc9c;
      color: white !important
    }

    /* Add media queries for smaller screens */
    @media screen and (max-width:720px) {

      .weekdays li,
      .days li {
        width: 13.1%;
      }
    }

    @media screen and (max-width: 420px) {

      .weekdays li,
      .days li {
        width: 12.5%;
      }

      .days li .active {
        padding: 2px;
      }
    }

    @media screen and (max-width: 290px) {

      .weekdays li,
      .days li {
        width: 12.2%;
      }
    }
  </style>
</head>

<body>
  {% load static %}
  <!-- <h1 style="text-align: center;">学习计划</h1> -->
  <div class="month">
    <ul>
      <li class="prev"><上月 </li>
      <li class="next">下月></li>
      <li style="text-align:center">
        <span style="font-size:18px" id="yearbox">2023年</span>
        <br>
        <span id="monthbox">10月</span>
      </li>
    </ul>
  </div>
  <ul class="weekdays">
    <li>星期一</li>
    <li>星期二</li>
    <li>星期三</li>
    <li>星期四</li>
    <li>星期五</li>
    <li>星期六</li>
    <li>星期日</li>
  </ul>
  <ul class="days"></ul>
  <script type="text/javascript">
    var currentDate = new Date();
    function showDateList() {
      let year = currentDate.getFullYear();
      let month = currentDate.getMonth() + 1;
      let date = currentDate.getDate();
      let firstWeekDay = new Date(year, month - 1, 1).getDay();
      let monthDays = new Date(year, month, 0).getDate();
      let str = "";
      let daylength = monthDays + firstWeekDay - 1;
      let startDay = firstWeekDay - 1
      if (firstWeekDay == 0) {
        daylength = monthDays + 6;
        startDay = 6;
      }
      for (var i = 0; i < daylength; i++) {
        if (i < startDay) {
          str += "<li></li>"
        }
        else {
          let today = new Date();
          let todate = (i - startDay + 1);
          console.log(date)
          if (year == today.getFullYear() && month == today.getMonth() + 1 && todate == today.getDate()) {
            str += "<li><span class='active'>" + todate + "</span></li>";
          }
          else {
            str += "<li>" + todate + "</li>";
          }
        }
      }
      document.querySelector("#monthbox").innerHTML = month + "月";
      document.querySelector("#yearbox").innerHTML = year + "年";
      document.querySelector(".days").innerHTML = str;
    }
    showDateList();
    document.querySelector(".next").onclick = function () {
      currentDate.setMonth(currentDate.getMonth() + 1);
      showDateList();
    }
    document.querySelector(".prev").onclick = function () {
      currentDate.setMonth(currentDate.getMonth() - 1);
      showDateList();
    }
  </script>





  <div class="uk-child-width-1-3@s uk-grid-match uk-margin-top" uk-grid style="width: 100%;">
    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <h3 class="uk-card-title uk-text-center">用户管理</h3>
        <hr>
        <p>
          <a href="/admin/auth/group/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: grid;"></span>&emsp;用户组管理</a>
        </p>
        <p>
          <a href="/admin/auth/user/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: user;"></span>&emsp;一级账户管理(登陆账户)</a>
        </p>
        <p>
          <a href="/admin/home/myuser/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: users;"></span>&emsp;二级账户管理(排课账户)</a>
        </p>
      </div>
    </div>

    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <h3 class="uk-card-title uk-text-center">课程管理</h3>
        <hr>
        <p>
          <a href="/admin/service/lesson_type/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: tag;"></span>&emsp;课程类型</a>
        </p>
        <p>
          <a href="/admin/service/scheduling/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: calendar;"></span>&emsp;进行排课</a>
        </p>
        <p>
          <a href="/admin/service/lesson_note/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: history;"></span>&emsp;记录上课</a>
        </p>
      </div>
    </div>



    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <h3 class="uk-card-title uk-text-center">博客和讲义</h3>
        <hr>
        <p><a href="/blog/" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: comments;"></span>&emsp;博客总数：{{ blog_count }}</a>
        </p>
        <p><a href="/teach/lesson" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: bookmark;"></span>&emsp;讲义总数：{{ lesson_count }}</a></p>
        <p><a href="/teach/training" style="text-decoration:none" target="_blank"><span
              uk-icon="icon: star;"></span>&emsp;训练总数：{{ training_count }}</a></p>

      </div>
    </div>
  </div>


  {% if notes %}
  <h2 class="uk-h2 uk-text-center">
    最近上课记录
  </h2>
  <hr
    style="height: 2px;padding: 0;border: none;text-align: center;background-image: linear-gradient(to right, rgba(60, 122, 198, 0), rgba(6, 58, 122, 1), rgba(60, 122, 198, 0));" />
  <table class="uk-table uk-table-striped uk-table-hover uk-table-large" style="vertical-align: center;">
    <thead>
      <tr class="uk-text-lead " style="font-weight:bold;">
        <th style="font-size: 1em;font-weight:bold; min-width: 50px;">序号</th>
        <th style="font-size:  1em;font-weight:bold; min-width: 100px;">课程名称</th>
        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 150px;">
          上课时间</th>
        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 150px;">
          下课时间</th>
        <th class="uk-text-center" style="font-size: 1em;font-weight:bold;min-width: 50px;">
          学员</th>
        <th class="uk-text-right" style="font-size: 1em;font-weight:bold;min-width: 50px;">
          教师</th>
        <th class="uk-text-right" style="font-size: 1em;font-weight:bold;min-width: 50px;">
            修改记录</th>
      </tr>
    </thead>
    <tbody>
      {% for lesson in notes %}
      <tr>
        <td style="font-weight:bold;vertical-align: middle;">{{ lesson.new_id }}</td>
        <td style="vertical-align: middle;">
          <a href="/service/lesson_note/{{ lesson.id }}" target="_blank">
            <dt class="uk-text-normal uk-text-primary">
              {{ lesson.title }}
            </dt>
          </a>
        </td>
        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{{ lesson.start }}</td>
        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{{ lesson.end }}</td>
        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{% autoescape off %}{{ lesson.stu_names }}
          {% endautoescape %}</td>
        <td class="uk-text-right uk-text-emphasis" style="font-size:0.75em;vertical-align: middle;">{{ lesson.teacher }}
        </td>
        <td class="uk-text-right" style="font-size:0.75em;vertical-align: middle;">
          <a href="/admin/service/lesson_note/{{ lesson.id }}/change" target="_blank">
            <dt class="uk-text-normal uk-text-primary">修改记录</dt>
          </a>
        </td>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endif %}


  <div class="uk-child-width-1-3@s uk-grid-match uk-margin-top" uk-grid style="width: 100%;">
    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <a href="/admin/service/lesson_note/" style="text-decoration:none" target="_blank">
          <h3 class="uk-card-title uk-text-center">今日课程</h3>
          <hr>
          <p>今日拟上课次数：<font color="blue">{{ today.plan }}</font>
          </p>
          <p>今日拟上课学生数：<font color="blue">{{ today.students_p }}</font>
          </p>
          <p>今日已上课次数：<font color="red">{{ today.already }}</font>
          </p>
          <p>今日已上课学生数：<font color="red">{{ today.students_a }}</font>
          </p>
        </a>
      </div>
    </div>

    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <h3 class="uk-card-title uk-text-center">本周课程</h3>
        <hr>
        <a href="/admin/service/lesson_note/" style="text-decoration:none" target="_blank">
          <p>本周拟上课次数：<font color="blue">{{ week.plan }}</font>
          </p>
          <p>本周拟上课学生数：<font color="blue">{{ week.students_p }}</font>
          </p>
          <p>本周已上课次数：<font color="red">{{ week.already }}</font>
          </p>
          <p>本周已上课学生数：<font color="red">{{ week.students_a }}</font>
          </p>
        </a>

      </div>
    </div>

    <div>
      <div class="uk-card uk-card-default uk-card-hover uk-card-body uk-background-muted">
        <h3 class="uk-card-title uk-text-center">本月课程</h3>
        <hr>
        <a href="/admin/service/lesson_note/" style="text-decoration:none" target="_blank">
          <p>本月拟上课次数：<font color="blue">{{ month.plan }}</font>
          </p>
          <p>本月拟上课学生数：<font color="blue">{{ month.students_p }}</font>
          </p>
          <p>本月已上课次数：<font color="red">{{ month.already }}</font>
          </p>
          <p>本月已上课学生数：<font color="red">{{ month.students_a }}</font>
          </p>
        </a>
      </div>
    </div>
  </div>
</body>